<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <!-- vue -->
    <script src="https://unpkg.zhimg.com/vue@2.7.15/dist/vue.js"></script>

    <!-- element-ui -->
    <link rel="stylesheet" href="https://unpkg.zhimg.com/element-ui/lib/theme-chalk/index.css">
    <script src="https://unpkg.zhimg.com/element-ui/lib/index.js"></script>
</head>

<body>

    <div id="ReplaceBatch">
        <el-container style="height: 1000px; border: 1px solid #eee">

            <el-aside width="50%">
                <div>
                    <el-input type="textarea" autosize placeholder="请输入内容" v-model="textarea1">
                    </el-input>
                </div>
                
            </el-aside>

            <el-container>
                <el-main>
                    <div>
                        <el-input type="textarea" autosize placeholder="请输入内容" v-model="textarea2">
                        </el-input>
                    </div>
                </el-main>
            </el-container>
        </el-container>
        
    </div>
</body>

</html>
<script>
    let app = new Vue({
        el: "#ReplaceBatch",
        data: () =>  {
            return {
                textarea1: ''
            }
        },
        computed: {
            textarea2: function () {
                return this.textarea1.replace(/el/g, "as").replace(/re/g, "txt");
                // return this.textarea1.replace(/\bel\b/g, "as");  // 全字匹配
            }
        }
    });
</script>